package com.csii.adhoc.dataunits.mapper;


import com.csii.adhoc.dataunits.UnitKey;
import com.csii.adhoc.dataunits.UnitKeyKey;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UnitKeyMapper {
    int deleteByPrimaryKey(UnitKeyKey key);

    int insert(UnitKey record);

    int insertSelective(UnitKey record);

    UnitKey selectByPrimaryKey(UnitKeyKey key);

    int updateByPrimaryKeySelective(UnitKey record);

    int updateByPrimaryKey(UnitKey record);

    List<UnitKey> getAllUnitKey(@Param("unitId") String unitId, @Param("type") String type);

    @Delete(" delete" +
            " from T_UNIT_KEY" +
            " where UNIT_ID = #{unitId,jdbcType=VARCHAR}" +
            "   and TYPE = #{type,jdbcType=VARCHAR} ")
    void delAllByUnitId(@Param("unitId") String unitId, @Param("type") String type);
}